package com.stenio.fancat.service.enums;

/**
 * @author zhangqiu
 * @date 2018/12/5
 * @desc
 **/
public enum OrderStatus {
    NEW(1,"未发货"),
    SEND(2,"已发货"),
    FINISH(3,"已完成"),
    CANCEL(4,"已取消");

    private int status;
    private String desc;
    OrderStatus(int status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public int getStatus() {
        return status;
    }

    public String getDesc() {
        return desc;
    }

    public static OrderStatus getEnumByStatus(Integer i){
        for(OrderStatus status:OrderStatus.values()){
            if(status.getStatus()==i){
                return status;
            }
        }
        return null;
    }
}
